package week1.day6;

/**
 * @Author fengzihao
 * @Date 2024-04-20 15:10
 */
public class AccountTest {

}

class Account {
    public static int initialId = 10001;
    int id;
    String password = "000000";
    double accountBalance;
    double annualSavingsInterest = 0.003;

    public double getBalance(int year, int annualSavingsInterest) {
        return accountBalance + accountBalance * year * annualSavingsInterest;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", password='" + password + '\'' +
                ", accountBalance=" + accountBalance +
                ", annualSavingsInterest=" + annualSavingsInterest +
                '}';
    }

    public Account(String password, double accountBalance) {
        this.id = initialId;
        initialId++;
        this.password = password;
        this.accountBalance = accountBalance;
    }

    public Account(String password) {
        this.id = initialId;
        initialId++;
        this.password = password;
    }

    public Account(double accountBalance) {
        this.id = initialId;
        initialId++;
        this.accountBalance = accountBalance;
    }
}
